<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common/head :: htmlhead">


<body>
<link rel="stylesheet" th:href="@{/static/layui/css/login.css}" media="all">
<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>共识算法改进系统<br>登录</h2>
        </div>
        <form th:action="@{/login}" method="post" class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username"
                       for="LAY-user-login-username"></label>
                <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名"
                       class="layui-input">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password"
                       for="LAY-user-login-password"></label>
                <input type="password" name="password" id="LAY-user-login-password" lay-verify="required"
                       placeholder="密码" class="layui-input">
            </div>
            <div class="layui-form-item">
                <div class="layui-row">
                    <div class="layui-col-xs7">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-vercode"
                               for="LAY-user-login-vercode"></label>
                        <input type="text" name="code" id="LAY-user-login-vercode" lay-verify="required"
                               placeholder="图形验证码" class="layui-input">
                    </div>
                    <div class="layui-col-xs5">
                        <div style="margin-left: 10px;">
                            <img id="codeimg" class="layadmin-user-login-codeimg" title="点击换一个" th:src="@{/createCode}" onclick="changeImg()">

                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" style="margin-bottom: 20px;">
                <p style="color: red" th:text="${error}"></p>
                <a th:href="@{/register/init}" class="layadmin-user-jump-change layadmin-link">注册帐号</a>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid" type="submit">登 入</button>
            </div>

        </form>
    </div>

    <div class="layui-trans layadmin-user-login-footer">

    </div>
</div>

<script>
    function changeImg(){
        var img = document.getElementById('codeimg');
        img.src = "createCode?d=" + Math.floor(Math.random()*100)
    }
</script>
</body>
</html>
